//
//  BSSBaseNavigationBar.h
//  BSSBaseDependTool
//
//  Created by wanglei on 2019/4/15.
//  自定义nav，提供一些简单方法

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "Masonry.h"

typedef NS_ENUM(NSInteger, BSSNavBarType) {
    BSSNavBarTypeLight,      // 白色 - 默认
    BSSNavBarTypeClear,      // 透明NavBar
};
typedef NS_ENUM(NSInteger, BSSNavBarTitleLabelType) {
    BSSNavBarTitleLabelTypeLeft,           // 左显示 - 默认
    BSSNavBarTitleLabelTypeCenter,         // 中显示
    BSSNavBarTitleLabelTypeNone,           // 无显示
};
typedef NS_ENUM(NSInteger, BSSNavBarLeftButtonType) {
    BSSNavBarLeftButtonTypeBack,        // 返回 - 默认
    BSSNavBarLeftButtonTypeNone,        // 无按钮
};

typedef NS_ENUM(NSInteger, BSSNavBarRightButtonType) {
    BSSNavBarRightButtonTypeNone,           // 没有按钮 - 默认
    BSSNavBarRightButtonTypeShare,          // 分享
};

@protocol BSSBaseNavigationBarDelegate <NSObject>

@optional
- (void)bss_navBarLeftButtonClicked:(UIButton *)sender;

- (void)bss_navBarRightButtonClicked:(UIButton *)sender;

@end


@interface BSSBaseNavigationBar : UIView

@property (nonatomic,   weak) id<BSSBaseNavigationBarDelegate> delegate;
/**
 nav背景图（状态栏+导航栏）
 */
@property (nonatomic, strong) UIImageView               *backgroundView;
/**
 状态栏背景图
 */
@property (nonatomic, strong) UIImageView               *statusBarView;

/**
 默认Navigation（正常自定义nav添加处，高度44.f）
 */
@property (nonatomic, strong) UIImageView               *navigationView;

/**
 标题lab
 */
@property (nonatomic, strong) UILabel                   *titleLabel;
@property (nonatomic, strong) NSString                  *title;

/**
 底部分割线
 */
@property (nonatomic, strong) UIView                    *separator;


@property (nonatomic, assign) BSSNavBarType             navBartype;
@property (nonatomic, assign) BSSNavBarTitleLabelType   titleLabelType;
@property (nonatomic, assign) BSSNavBarLeftButtonType   leftButtonType;
@property (nonatomic, assign) BSSNavBarRightButtonType  rightButtonType;

/**
 左按钮（默认返回模式）
 */
@property (nonatomic, strong) UIButton                  *leftButton;

/**
 右按钮（默认隐藏）
 */
@property (nonatomic, strong) UIButton                  *rightButton;

/**
 清除并隐藏左按钮
 */
- (void)clearLeftButton;

/**
 清除并隐藏右按钮
 */
- (void)clearRightButton;

/**
 清除背景图并设置成透明
 */
- (void)clearBackground;



/**
 自定义navBar（状态栏+导航栏）

 @param backgroundView 状态栏+导航栏高度
 @param navBar 粘贴到制定navBar（一般是当前控制器的navBar，self.navBar）
 @return BSSBaseNavigationBar
 */
+ (BSSBaseNavigationBar *)initWithBackgroundView:(UIView *)backgroundView
                                        toNavBar:(BSSBaseNavigationBar *)navBar;

/**
 自定义navigationView

 @param navigationView 自定义navigationView 高度为44（不包含状态栏）
 @param navBar 粘贴到制定navBar（一般是当前控制器的navBar，self.navBar）
 @return BSSBaseNavigationBar
 */
+ (BSSBaseNavigationBar *)initWithNavView:(UIView *)navigationView
                                 toNavBar:(BSSBaseNavigationBar *)navBar;
@end


